<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ include file="/common/taglib.jsp" %>
<!DOCTYPE html>
<html lang="ko">
<head>
<title> 한국의 논매기 소리 </title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta charset="utf-8">
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico"/>
<link href="/css/reset.css" type="text/css" rel="stylesheet" />
<link href="/css/common.css" type="text/css" rel="stylesheet" />
<link href="/css/layout.css" type="text/css" rel="stylesheet" />
<link href="/css/ui.css" type="text/css" rel="stylesheet" />
<script src="/js/jquery.min.js"></script>
<script src="/js/jquery-ui-1.10.4.custom.min.js" type="text/javascript"></script>
<!--script src="/js/gnb.min.js" type="text/javascript"></script-->
<script src="/js/gnb_ui.js" type="text/javascript"></script>
<script src="/js/left_menu.js" type="text/javascript"></script>
<script src="/js/ui.js" type="text/javascript"></script>
<script type="text/javascript">
//상세폼
function fncSave(){
	var form = document.itemVO;
	form.action = "/admin/uploadProcess.do";
	form.submit();
}


function fncChangeArea1() {
	$("#areaCd").val($("#region1 option:selected").val());
	fncChangeArea("region2", $("#areaCd").val());
	$("#region3").html("<option value=''>선택</option>");
}

function fncChangeArea2() {
	$("#areaCd").val($("#region2 option:selected").val());
	fncChangeArea("region3", $("#areaCd").val());
}

function fncChangeArea3() {
	$("#areaCd").val($("#region3 option:selected").val());
}

function fncChangeArea(cNm, areaCd) {
	$.getJSON('/item/changeArea.do?areaCd='+areaCd, function(data) {
		var resultList = data.regionList;
		var itemListHtml = "";
		itemListHtml += "<option value=''>선택</option>";
		if(resultList.length > 0){
			for(var i = 0; i < resultList.length; i++) {
				var region = resultList[i];
				itemListHtml += "<option value=\""+region.codeId+"\">"+region.codeName+"</option>";
			}
		}
		$("#"+cNm).html(itemListHtml);
	});
}
</script>
</head>
<body>
<div id="">
	<!-- Header -->
	<jsp:include page="../common/header.jsp"></jsp:include>
	<!--// Header -->
	<!-- Content -->
	<!-- 컨텐츠 -->
	<div id="container" class="bg_sub">
		<div style="border-top:0px solid #e5e6e6; background:#fff;">
			<!-- 내용영역 -->
			<div style="width:1024px; margin:0 auto; border-left:0px solid #dddddd; bottom;">
				<div >
					<div >
						<h3>아이템 업로드</h3>
					</div>
					<!-- 내용 -->
					<form:form commandName="itemVO" name="itemVO" method="post" enctype="multipart/form-data">
						 <form:hidden path="areaCd"/>
					<div class="mr37 ">
						<!-- 리스트 목록 -->
						<div class="tb_sch_list">
							<table>
								<tbody>
									<tr>
										<th scope="row">파일</th>
										<td>
											<input type="file" name="excelFile"/>
										</td>
									</tr>
									<c:if test="${fn:length(result) > 0 }">
									<tr>
										<th scope="row">결과</th>
										<td>
											${result }
										</td>
									</tr>
									</c:if>
								</tbody>
							</table>
						</div>
						<!-- //리스트 목록 -->
						<!-- 버튼 -->
						<div class="btn_area">
							<div class="t_center">
								<a href="javascript:fncSave()" class="btn_list_view"><span>확인</span></a>
							</div>
						</div>
						<!-- //버튼 -->
					</div>
					</form:form>
					<!-- //내용 -->	
				</div>
			</div>
			<!-- //내용영역 -->
		</div>
	</div>
	<!-- //컨텐츠 -->
	<!--// Content -->

	<jsp:include page="../common/footer.jsp"></jsp:include>
</div>
</body>
<script type="text/javascript">
//<![CDATA[
(function ($) {
	$(document).ready(function() {
		$('.search').schSelect();
		//gnb 메뉴
		navigation("gnb_wrap", "slide");
		
		$( "#keyword" ).keypress(function( event ) {
			  if ( event.which == 13 ) {
				  searchWithinResults();
			  }
		});
		
		$( "#searchButton" ).click(function( event ) {
			searchWithinResults();
		});

	});
}(jQuery));
//]]>
</script>
</html>